package com.tang.k.wechatmessage.application.NewsDetail;


import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;


import com.tang.k.wechatmessage.application.R;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * 通过WebView简单显示
 */
public class DetailActivity extends AppCompatActivity {

    @InjectView(R.id.acDetail_webview)
    WebView acDetailWebview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail_actiivity);

        ButterKnife.inject(this);
        Intent intent = getIntent();
        String url = intent.getStringExtra("url");
        acDetailWebview.getSettings().setJavaScriptEnabled(true);

        acDetailWebview.getSettings().setBlockNetworkImage(false);
        acDetailWebview.loadUrl(url);

        acDetailWebview.setWebViewClient(new WebViewClient() {

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return false;
            }
        });
    }
}
